<?php
//$idCliente = $this->uri->segment(3);
$query = $this->clientemodel->buscarClientePorId($idCliente)->row();
?>
<div class="span10">
		  <div class="row-fluid">
			<div class="page-header">
				<h1><?=$titulo; echo" ".$idAtendimento;?></h1>
                                
			</div>
			<?php $atributos_formulario = array('id'=>'exm1','role'=>'form','onsubmit'=>'PreventMultipleSubmit()','class'=>'form-inline');
                            echo form_open ("atendimentocontroller/cadastrarProntuario",$atributos_formulario);
                            echo form_input(array('name'=>'idCliente', 'id'=>'idCliente', 'type'=>'hidden','class'=>'input-large ','placeholder'=>'','value'=>$idCliente), set_value($idCliente));
                            echo form_input(array('name'=>'idAtendimento', 'id'=>'idAtendimento', 'type'=>'hidden','class'=>'input-large ','placeholder'=>'','value'=>$idAtendimento), set_value($idAtendimento));
                                   
                            if(validation_errors())
                            {?>
                                <div class="alert alert-danger">
                                    <button type="button" class="close " data-dismiss="alert">&times;</button>
                                    <span><?=validation_errors();?></span>
                                </div>
                            <?php                            
                            }
                            
                             if($this->session->flashdata('cadastrook')){?>
                                <div class="alert alert-success">
                                    <button type="button" class="close " data-dismiss="alert">&times;</button>
                                    <p><?=$this->session->flashdata('cadastrook');?></p>
                                </div>
                             <?php
                            }?>
                      
                         
                      <div style="float: left; padding: 10px; border-right: 0px solid #f89406; ">
                     
                          <h2>Descreva o prontuário: </h2>
                          <hr />
                            
                                
                                 
				
                                 
<?php
    $textarea_data = array('id' => 'prontuario',
                           'name' => 'prontuario',
                           'rows' => '15',
                           'cols' => '10',
                           'maxlength'=>'300',
                           'placeholder'=>'Digite uma descrição',
                           'class'=>'textarea',
                           //'required'=>'required' 
                       );
    echo form_textarea($textarea_data); 
?>
                                 
                                 <br><br>
                             

					<div class="form-actions">
						<input type="submit" class="btn btn-success btn-large" value="Salvar" /> 
                                                <?=anchor(base_url()."principalcontroller","Cancelar",array('class'=>'btn'));?>                                                
					</div>					
				</form>
                      </div>
                       <div style="float: left; padding: 10px; width: 700px;">
                          <div style="float: right; padding: 10px;">
                               <?php       $imagem = array(
                                            'src' => "img/".$query->foto,
                                            'class' => 'thumbnail',
                                            'width' => '100',
                                            'height' => '120',
                                            );?>
											 
                                        <?=img($imagem);?>
                          </div>
                          <div style="padding: 10px; float: right">
                              <h3>Nome: <?=$query->nome;?></h3>
                              <h3>Data de Nascimento: <?=$query->dataNascimento;?></h3>
                          <h3>Telefone: <?=$query->telefone;?></h3>
                          <h3>Cpf: <?=$query->cpf;?></h3>
                          <h3>Data Incío Tratamento: <?=$query->dataInicioTratamento;?></h3>
                          </div> 
                      </div> <br clean="both"  />               
                        
                        
		  </div>
    <h2>Lista dos Prontuários:</h2>
    <hr />
    <?php
    $buscaProntuario = $this->atendimentomodel->buscarAcaoPorCliente($query->id_cliente,"PRONTUARIO")->result(); ?>
    
    <table class="table table-striped table-bordered">
				<thead>
					<tr>
						<th>Data</th>
						<th>Texto</th>
                                                <th>Número Atendimento</th>                                                
						
					</tr>
				</thead>
				<tbody>
                                    <?php
                                     foreach ($buscaProntuario as $prontuarios ){ ?> 
                                    <tr class="pending-user odd gradeX">
                                        <td><?=$prontuarios->data;?></td>
                                        <td><?=$prontuarios->texto;?></td>
                                        <td><?=$prontuarios->numeroAtendimento;?></td>
                                        
                                    </tr> 
                                <?php
                                     }?>
				
                               
				</tbody>
			</table>

    
        </div>